<?

	include("inc/config.inc.php");

	$firstname = mysqli_real_escape_string($con,$_POST[firstname]);
	$lastname = mysqli_real_escape_string($con,$_POST[lastname]);
	$user = mysqli_real_escape_string($con,$_POST[user]);
	$email = mysqli_real_escape_string($con,$_POST[email]);
	$role = mysqli_real_escape_string($con,$_POST[role]);
	$manager = mysqli_real_escape_string($con,$_POST[manager]);
	$entitlement = mysqli_real_escape_string($con,$_POST[entitlement]);

	// Check we are HR!
	if ($_SESSION[role] != "HR")
		die ("Error 51 - User error - Please contact support.");
	            
	mysqli_query($conn, "INSERT INTO users SET user='$user', firstname='$firstname', lastname='$lastname', email='$email', role='$role', manager='$manager', entitlement=$entitlement, prestaged=0");
	
	header("Location:main.php");


?>
